package top.continew.admin.jobfair.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import jakarta.annotation.Resource;
import lombok.RequiredArgsConstructor;

import org.springframework.stereotype.Service;

import top.continew.starter.extension.crud.service.impl.BaseServiceImpl;
import top.continew.admin.jobfair.mapper.ResumeMapper;
import top.continew.admin.jobfair.model.entity.ResumeDO;
import top.continew.admin.jobfair.model.query.ResumeQuery;
import top.continew.admin.jobfair.model.req.ResumeReq;
import top.continew.admin.jobfair.model.resp.ResumeDetailResp;
import top.continew.admin.jobfair.model.resp.ResumeResp;
import top.continew.admin.jobfair.service.ResumeService;

import java.util.List;

/**
 * 简历管理业务实现
 *
 * @author xiahaike
 * @since 2024/09/11 10:27
 */
@Service
@RequiredArgsConstructor
public class ResumeServiceImpl extends BaseServiceImpl<ResumeMapper, ResumeDO, ResumeResp, ResumeDetailResp, ResumeQuery, ResumeReq> implements ResumeService {

    @Resource
    private ResumeMapper resumeMapper;

    @Override
    public List<ResumeDO> listByIds(List<Long> ids) {
        return resumeMapper.selectBatchIds(ids);
    }

    @Override
    public List<ResumeDO> listByStudentId(Long studentId) {
        QueryWrapper<ResumeDO> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("student_id", studentId);
        return resumeMapper.selectList(queryWrapper);
    }
}